<?php /* Smarty version Smarty-3.1.13, created on 2013-12-25 20:45:32
         compiled from "E:\Apache\www\hyqx\admin\templates\defaults\channel_modify.htm" */ ?>
<?php /*%%SmartyHeaderCode:2992652bad36c1855b2-92161914%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '34a5dade1dafe068fae076b000cd02a427e00619' => 
    array (
      0 => 'E:\\Apache\\www\\hyqx\\admin\\templates\\defaults\\channel_modify.htm',
      1 => 1387198000,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2992652bad36c1855b2-92161914',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'title' => 0,
    'channel_id' => 0,
    'pre_id' => 0,
    'channel_name' => 0,
    'all_channel' => 0,
    'all_article_channel' => 0,
    'pre_channel_grade' => 0,
    'channel_model' => 0,
    'article_model' => 0,
    'channel_describe' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_52bad36c1f5c15_90480132',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_52bad36c1f5c15_90480132')) {function content_52bad36c1f5c15_90480132($_smarty_tpl) {?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $_smarty_tpl->tpl_vars['title']->value;?>
</title>
<script language="javascript" type="text/javascript"
	src="js/default/jquery-1.9.1.min.js"> </script>
	<script language="javascript" type="text/javascript"
	src="include/tinymce/tiny_mce.js"> </script>
<script language="javascript" type="text/javascript"
	src="js/default/tinymce_channel_config.js"></script>
<script language="javascript" type="text/javascript">
$=jQuery;
tmp_choice=0;
$(document).ready(function(){
    $("#channel_has_articles").hide();
    channel_id=$("#channel_id").val();
    $("#article_move_to_channel option[value="+channel_id+"]").attr("disabled","disabled");
});
 function selectChannelModel(){
		window.open('channel_model_select.php','newwindow','height=530,width=1000,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
 }
 function selectArticleModel(){
		window.open('article_model_select.php','newwindow','height=530,width=1000,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
	 }
 

 
function changePreChannelVisitPath(){
	if(tmp_choice!=0){
	    $("#article_move_to_channel option[value=0]").attr("selected","selected");
	    $("#article_move_to_channel option[value="+tmp_choice+"]").removeAttr("disabled");
	    tmp_choice=0;
	}
	 choice=parseInt($("#pre_channel").val());
	 if(choice==0){
		 $("#channel_has_articles").hide();
	 }
	 else{
		 send_url="pre_channel_visit_path_get.php";
		 $.get(send_url,{channel_id:choice,timestamp:new Date().getTime()},function(data){
			 data_tmp=data.split(",");
			 $("#pre_channel_grade").val(data_tmp[0]);
			 if(data_tmp[1]==1){
				 tmp_choice=choice;
				 $("#whether_channel_has_articles").val("1");
			     $("#channel_has_articles").show();
			     $("#article_move_to_channel option[value="+choice+"]").attr("disabled","diasbled");
			 }
			 else{
				 $("#whether_channel_has_articles").val("0");
			     $("#channel_has_articles").hide();
			 }
		 });
	 }
 }

function checkSubmit()
{
	if($("#channel_name").val()=='')
	{
		alert('栏目名称不能为空！');
		return false;
	}	
	
	
	if($("#channel_model").val()=='')
	{
		alert('栏目模版不能为空！');
		return false;
	}
	if($("#article_model").val()=='')
	{
		alert('文章模版不能为空！');
		return false;
	}
}
</script>
<style>
/*主体*/
html,body {
	width:  100%;
	height: 100%;
	margin-top: 3px;
	font-family: "微软雅黑";
	font-size: 13px;
	margin:0px;
	color:#333;
}

#main {
    padding-left:20px;
    padding-top:1px;
	border: 1px double #aaa;
}

.division {
	border: 1px dotted #aaa;
}
a{
   text-decoration: none;
}
div{
 margin:2px;
 background:#EEFFEE;
}

#channel_has_articles{
 color:red;
}
#channel_visit_path_exist{
 color: red;
}
.readonly{
  border:0;
  background:#EEFFEE;
}
#submit{
 padding-top:5px;
  padding-bottom:5px; 
}
</style>
</head>
<body>
	<div id="main">
		<form action="channel_modify_save.php" method="post" id="forms" onSubmit="return checkSubmit()">
		   <input type="hidden" id="channel_id" name="channel_id" value="<?php echo $_smarty_tpl->tpl_vars['channel_id']->value;?>
"/>
		   <input type="hidden" id="channel_old_pre_id" name="channel_old_pre_id" value="<?php echo $_smarty_tpl->tpl_vars['pre_id']->value;?>
"/>
		   <span><img alt="必填" title="必填" src="images/channel/flag.png" width="10px" height="10px">
			栏目名称：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
		    <input id="channel_name" name="channel_name" type="text" size="20" maxlength="50" value="<?php echo $_smarty_tpl->tpl_vars['channel_name']->value;?>
"/>
				<div class="division"></div>
			<img alt="必填" title="必填" src="images/channel/flag.png" width="10px" height="10px">
			<span>上级栏目：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
			<select name='pre_channel' id='pre_channel' onchange="changePreChannelVisitPath();">   
				<option value='0'>....根栏目....</option>
				<?php echo $_smarty_tpl->tpl_vars['all_channel']->value;?>

			</select><span>[注：不允许从父级目录移动到子级目录，只允许子级移动到更高级或同级或不同父级]</span>
			  <script language="javascript">
			   pre_id=<?php echo $_smarty_tpl->tpl_vars['pre_id']->value;?>
;
			   current_id=<?php echo $_smarty_tpl->tpl_vars['channel_id']->value;?>
;
			   $("#pre_channel option[value="+pre_id+"]").prop("selected",true);
			   $("#pre_channel option[value="+current_id+"]").attr("disabled","disabled");
			   </script>
			
			<input type="hidden" name="whether_channel_has_articles" id="whether_channel_has_articles" value="0"/>
			<div id="channel_has_articles">
			<div class="division"></div>
			<span>该上级栏目含有文章,移动至：</span>
			<select  name='article_move_to_channel' id='article_move_to_channel'>
				<option value='0'>..该修改的栏目..</option>
				<?php echo $_smarty_tpl->tpl_vars['all_article_channel']->value;?>

			</select>
			</div>
			<div class="division"></div>
			<input id="pre_channel_grade" name="pre_channel_grade" value="<?php echo $_smarty_tpl->tpl_vars['pre_channel_grade']->value;?>
" type="hidden"/>
			<img alt="必填" title="必填" src="images/channel/flag.png" width="10px" height="10px">
			<span>栏目模版：&nbsp;&nbsp;</span>
			<input name="channel_model" id="channel_model" size="25"  value="<?php echo $_smarty_tpl->tpl_vars['channel_model']->value;?>
"/><a href="javascript:" onclick="selectChannelModel();"><span>&nbsp;&nbsp;&nbsp;点击更换栏目模版</span></a>
			<div class="division"></div>
			<img alt="必填" title="必填" src="images/channel/flag.png" width="10px" height="10px">
			<span>内容模版：&nbsp;&nbsp;</span>
			<input name="article_model" id="article_model" size="25" value="<?php echo $_smarty_tpl->tpl_vars['article_model']->value;?>
"/><a href="javascript:" onclick="selectArticleModel();"><span>&nbsp;&nbsp;&nbsp;点击更换文章模版</span></a>
			<div class="division"></div>
			<span>栏目描述：&nbsp;&nbsp;</span>
			<textarea name="channel_describe" editor_id="channel_describe" id="channel_describe" mce_editable="true"><?php echo $_smarty_tpl->tpl_vars['channel_describe']->value;?>
</textarea>
	       <div align="center" id="submit"><input type="submit" title="保存" name="submit" value="保存" /></div>
	</form>
	</div>
</body>
</html><?php }} ?>